<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

class Timesheet_Model extends CI_Model {
	
	private $table= 'timesheets';
	private $shiftingModel;
	function __construct() {
		parent::__construct();
		$this->shiftingModel = $this->load->model('Shifting_Model');
	}
	
	function timeInOut ($userId, $timeIn, $timeOut){
		$shiftId = $this->shiftingModel->getShiftId($userId);
		$data = array('time_in'=>$timeIn, 'time_out'=>$timeOut, 'user_id'=>$userId, 'shift_id'=>$shiftId);
		$this->db->insert($this->table, $data);
		return $this->db->insert_id();
	}

}